To all, |
Re: DXL and Artisan Studio Did you notice the typo in your code? string oleCallResult = null; // "oleCallResul" misses a T so it will be always null, so the failure might be the ResetQueryItems call oleCallResul = oleMethod(myStudioApi,"ResetQueryItems"); if (!null oleCallResult)
|
Re: DXL and Artisan Studio Mathias Mamsch - Fri Feb 05 15:27:26 EST 2010 Did you notice the typo in your code? string oleCallResult = null; // "oleCallResul" misses a T so it will be always null, so the failure might be the ResetQueryItems call oleCallResul = oleMethod(myStudioApi,"ResetQueryItems"); if (!null oleCallResult)
|
Re: DXL and Artisan Studio Mathias Mamsch - Fri Feb 05 15:27:26 EST 2010 Did you notice the typo in your code? string oleCallResult = null; // "oleCallResul" misses a T so it will be always null, so the failure might be the ResetQueryItems call oleCallResul = oleMethod(myStudioApi,"ResetQueryItems"); if (!null oleCallResult)
No - I hadn't spotted the typo. The 'resetQueryItems' method is now returning an error string. Without Artisan installed I don't think engineers will be able to help with this one. The problem I'm having is with the OMTE.Projects collection as every object method I call returns the error string 'OLE Problem : Failed to get iterator'. I can read the objects properties but not any of its associations. Ultimately what I want to do it use own COM API to connect with Artisan Studio and return handles to certain model elements which the DXL will then process and creates as module objects. However if create an object of my own COM DLL Class, from DXL, and run any methods which interact with the OMTE.Projects collection I get the same error string 'OLE Problem : Failed to get iterator'. If I call the same COM object from a VB application it works perfectly when interacting the OMTE.Projects collection. Note that I had this all working with Doors 8. I'd love to hear from anyone who is able to test the previously posted DXL script (with Mathias' corrections) using Doors 8 and 9 with Studio version 7. Thanks again for your reply. Paul. |
Re: DXL and Artisan Studio llandale - Sun Feb 07 02:59:39 EST 2010
|
Re: DXL and Artisan Studio Paul_Butcher - Mon Feb 08 04:55:04 EST 2010 https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14230157� |
Re: DXL and Artisan Studio SystemAdmin - Mon Feb 08 05:26:21 EST 2010 |
Re: DXL and Artisan Studio
// Create a connection with the standard Studio API
OleAutoObj myStudioApi = oleCreateAutoObject("OMTE.Projects");
// Loop through the projects
string oleCallResult = null;
oleCallResult = oleMethod(myStudioApi,"ResetQueryItems");
if (!null oleCallResult)
{
errorBox ("ResetQueryItems Error : " oleCallResult);
}
else
{
bool moreProjects = false;
oleCallResult = null;
oleCallResult = oleMethod(myStudioApi, "MoreItems", null, moreProjects);
if (!null oleCallResult)
{
errorBox ("MoreItems Error : " oleCallResult);
}
else
{
while (moreProjects)
{
OleAutoObj aProject = null;
oleCallResult = oleMethod(myStudioApi, "NextItem", null, aProject);
if (!null oleCallResult)
{
errorBox ("NextItem Error : " oleCallResult);
}
else
{
infoBox(getProperty(aProject, "Name"));
}
}
}
}
|
Re: DXL and Artisan Studio Mathias Mamsch - Fri Feb 05 15:27:26 EST 2010 Did you notice the typo in your code? string oleCallResult = null; // "oleCallResul" misses a T so it will be always null, so the failure might be the ResetQueryItems call oleCallResul = oleMethod(myStudioApi,"ResetQueryItems"); if (!null oleCallResult)
Hi Mathias,
OleAutoObj objExcel = oleCreateAutoObject("Excel.Application")
OleAutoObj objWorkbooks
OleAutoObj objSpreadSheet
OleAutoArgs autoArgs = create
bool excelVisible = false
string result
/* Make Excel visible to the user */
oleGet(objExcel, "Visible", excelVisible)
if (!excelVisible)
olePut(objExcel,"Visible", true)
/* Add new workbook */
oleGet(objExcel,"Workbooks", objWorkbooks)
oleMethod(objWorkbooks,"Add")
put(autoArgs, "Sheet1")
/* Add new worksheet and activate it */
oleMethod(objExcel,"Sheets", autoArgs,
objSpreadSheet)
if (!null objSpreadSheet)
{
infoBox ("Navigated an association!");
}
else
{
errorBox("Failed to navigate an association!");
}
|
Re: DXL and Artisan Studio Paul_Butcher - Mon Feb 08 06:45:12 EST 2010
Hi Mathias,
OleAutoObj objExcel = oleCreateAutoObject("Excel.Application")
OleAutoObj objWorkbooks
OleAutoObj objSpreadSheet
OleAutoArgs autoArgs = create
bool excelVisible = false
string result
/* Make Excel visible to the user */
oleGet(objExcel, "Visible", excelVisible)
if (!excelVisible)
olePut(objExcel,"Visible", true)
/* Add new workbook */
oleGet(objExcel,"Workbooks", objWorkbooks)
oleMethod(objWorkbooks,"Add")
put(autoArgs, "Sheet1")
/* Add new worksheet and activate it */
oleMethod(objExcel,"Sheets", autoArgs,
objSpreadSheet)
if (!null objSpreadSheet)
{
infoBox ("Navigated an association!");
}
else
{
errorBox("Failed to navigate an association!");
}
|
Re: DXL and Artisan Studio "Unlike the previous version, DOORs 2009 now uses a library called libeay32.dll which is also used by Artisan Studio (the Enabler software, to be more precise). Unfortunately, the two products use incompatible versions of this dll, and they cannot be interchanged. This does not normally cause any problems to either tool, but if you load the Studio Automation object into the DOORs process (as you do from your DXL) Windows attempts to reuse the loaded dll which then causes an error because it is not compatible with the one Studio needs." I'm thinking that the only answer is to write the entire application outside of DXL and then send DXL snippets into Doors. |
Re: DXL and Artisan Studio Paul_Butcher - Fri Feb 12 04:55:35 EST 2010 One way to resolve this would be to patch DOORS.exe to rename the library in the import section. You could replace the "libeay32.dll" string by "libeayXX.dll" and rename the dll file. This way you would resolve the version abiguity - but it would be hard to roll out a change like that. There might be another way to help you with that. Windows XP implemented several mechanisms to get out of DLL Hell. You might want to read this MSDN page. http://msdn.microsoft.com/en-us/library/ms811700.aspx Cite: DLL/COM Redirection DLL/COM redirection requires that when the application is deployed, the application executable and all isolated components be installed into the application directory rather than the system directory. Additionally, a ".local" file is deployed to the application directory to modify the Windows binding behavior, so that the application binds to the isolated components rather than the globally shared version. Thus, the application will use a component that can run safely side by side with a different version of the same component that is installed elsewhere, in another application directory or in the system directory. If another application on the system requires a different version, your application is unaffected and both applications will run with their respective versions of the component. I am not 100% sure, but I bet it is possible to tell windows not to reuse the same DLL. Regards, Mathias |